using System.Collections.Generic;
using System.Linq;
using roster.Domain;

namespace roster.Domain
{
    public abstract class LootToken : ILootToken
    {
        public abstract string Name { get; }
        protected abstract IEnumerable<Class> EligibleClasses { get;}

        public virtual IEnumerable<IPlayer> GetEligiblePlayers(IEnumerable<IPlayer> players)
        {
            return players.Where(x => EligibleClasses.Contains(x.Class));
        }

        public override string ToString()
        {
            return Name;
        }
    }
}